﻿// ParseLib - An open source library for natural language processing.
// Copyright (C) Kais Dukes, 2012. E-mail: kais@kaisdukes.com
// http://parselib.org

using ParseLib.Corpora;

namespace ParseLib.Tagging.Brill
{
    public class BrillToken
    {
        private readonly IToken _token;
        private readonly PartOfSpeech[] _tags;

        public BrillToken(IToken token, PartOfSpeech[] tags)
        {
            _token = token;
            _tags = tags;
        }

        public string Text
        {
            get { return _token.Text; }
        }

        public PartOfSpeech CurrentTag { get; set; }

        public PartOfSpeech CorrectTag
        {
            get { return _token.PartOfSpeech; }
            set { _token.PartOfSpeech = value; }
        }

        public bool IsCorrect
        {
            get { return CurrentTag == CorrectTag; }
        }

        public PartOfSpeech[] Tags
        {
            get { return _tags; }
        }

        public bool CanTag(PartOfSpeech tag)
        {
            for (var i = 0; i < _tags.Length; i++)
            {
                if (_tags[i] == tag) return true;
            }
            return false;
        }
    }
}